// import * as constants from './constants'
// Immutable对象不可被变更
// fromJS可以帮我们把JS对象转换成Immutable对象
import {fromJS} from "immutable";
import * as constants from './constants';

const defaultState = fromJS({
    title:"",
    content:""
});

export default (state = defaultState, action) => {
    switch (action.type) {
        case constants.CHANGE_DETAIL:
            return state.merge({
                title:action.data.title,
                content:action.data.content
            });
        default:
            return state;
    }
}
